#pragma once
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
#include<stdbool.h>

typedef int HPDataType;

struct Heap
{
	HPDataType* a;
	int size;
	int capacity;
};

typedef struct Heap Heap;

void HeapInit(Heap* ph);
void HeapInitArray(Heap* ph, int* array, int n);
void Swap(HPDataType* x, HPDataType* y);
void Swap(HPDataType* x, HPDataType* y);
void HeapPush(Heap* ph, HPDataType x);
void HeapAdjustDown(HPDataType* a, int n, int parent);
bool isHeapEmpty(Heap* ph);
void HeapPop(Heap* ph);
void HeapTop(Heap* ph);
int HeapSize(Heap* ph);
void HeapDestroy(Heap* ph);